package com.liaozl.sca.order.feign;

import com.liaozl.sca.common.constants.ServiceNames;
import com.liaozl.sca.common.dto.Result;
import com.liaozl.sca.order.dto.OrderDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Description:
 * @version: v1.0.0
 * @author: liaozuliang
 * @date: 2021/9/17 17:07
 */
@FeignClient(ServiceNames.ORDER_WEB)
public interface OrderFeign {

    @PostMapping("/order/insert")
    Result<Boolean> insert(@RequestBody OrderDTO orderDTO);

    @PostMapping("/order/delete")
    Result<Boolean> delete(@RequestParam("orderNo") String orderNo);

    @PostMapping("/order/update")
    Result<Boolean> update(@RequestBody OrderDTO orderDTO);

    @GetMapping("/order/getByOrderNo/{orderNo}")
    Result<OrderDTO> getByOrderNo(@PathVariable("orderNo") String orderNo);

    @GetMapping("/order/getOrderDetail/{orderNo}")
    Result<Map<String, Object>> getOrderDetail(@PathVariable("orderNo") String orderNo);
}
